<?php include PATH_TPL."/admin/tpl.header.phtml"?>
<div class="main-container inner">
    <div class="main-content">
        <div class="container-fluid">
            <div class="row bt">
                <div class="col-lg-12 bg">
                    <ol class="breadcrumb">
                        <li class="active">
                            <i class="fa  fa-fw fa-reorder"></i>  直播列表
                       </li>
                    </ol>
                </div>
            </div>
            <div class="row">
                <div class="col-md-4">
                    <a class="btn btn-success" href="admin_live/add">添加直播</a>
                </div>
                <div class="col-md-8">
                    <form method="get" action="/admin_live">
                        <div class="form-group col-md-6">
                            <div class="input-group date form_date" data-date="<?=date("Y-m-d",time())?>" data-date-format="yyyy-mm-dd" data-link-field="start_time">
                                <input class="form-control" size="16" type="text" value="" readonly placeholder="输入直播开始日期搜索">
                                <span class="input-group-addon"><span class="glyphicon glyphicon-remove"></span></span>
                                <span class="input-group-addon"><span class="glyphicon glyphicon-th"></span></span>
                            </div>
                            <input type="hidden" id="start_time" value="" name="start_time" /><br/>
                        </div>
                        <div class="form-group input-group col-md-6 pull-righ">
                            <input type="text" placeholder="输入直播标题关键词搜索" name="key" class="form-control">
                            <span class="input-group-btn">
                              <button type="button" class="btn btn-default" id="search"><i class="fa fa-search"></i></button>
                            </span>
                        </div>
                    </form>
                </div>

                </div>
            </div>

            <div class="panel-body text-center">
                <table class="table table-hover" id="sample-table-1">
                    <thead>
                        <tr>
                            <td>编号</td>
                            <td>微吼活动ID</td>
                            <td>直播标题</td>
                            <td>封面图片</td>
                            <td>讲师</td>
                            <td>简介</td>
                           <!-- <td>直播等级</td>-->
                            <td>开始时间</td>
                            <td>结束时间</td>
                            <td>登记人数</td>
                            <td>推送时间</td>
                            <td>操作</td>
                        </tr>
                    </thead>
                    <?foreach($tDatas as $tRow){?>
                    <tr>
                        <td><?=$tRow['id']?></td>
                        <td><?=empty($tRow['webinar_id'])?"无":$tRow['webinar_id']?></td>
                        <td><?=$tRow['title']?></td>
                        <td class="center slt"><img src="<?=$tRow['img']?>" alt="image"/></td>
                        <td><?=$tRow['lecturer_name']?></td>
                        <td><?=$tRow['descriptions']?></td>
                        <!--<td>
							<input type="radio" name="live_type<?=$tRow['id']?>" s="<?=$tRow['id']?>" value="0" <?if(empty($tRow['live_type'])){echo 'checked';}?>/>普通
							<input type="radio" name="live_type<?=$tRow['id']?>" s="<?=$tRow['id']?>" value="1" <?if($tRow['live_type'] == '1'){echo 'checked';}?>/>VIP
                        </td>-->
                        <td><?=date('Y-m-d H:i',$tRow['start_time'])?></td>
                        <td><?=date('Y-m-d H:i',$tRow['end_time'])?></td>
                        <td>&nbsp;&nbsp;<a href="/admin_register/index?lid=<?=$tRow['id']?>"><?=$tRow['register']?></a></td>
                        <td><?=empty($tRow['push_time'])?"-":date('Y-m-d H:i',$tRow['push_time'])?></td>
                        <td>
                            <div class="visible-md visible-lg hidden-sm hidden-xs">
                                <a href="/admin_live/edit?id=<?=$tRow['id']?>" class="btn btn-blue btn-xs tooltips" data-placement="top" data-original-title="编辑"><i class="fa fa-edit"></i></a>
                                <a href="/admin_comment/index?live_id=<?=$tRow['id']?>" class="btn btn-green btn-xs tooltips" data-placement="top" data-original-title="查看评论"><i class="fa fa-search"></i></a>
                                <a href="#"  onclick="cg_confirm_del('/admin_live/del?id=<?=$tRow['id']?>','/admin_live')" class="btn btn-orange btn-xs tooltips demo_4" data-placement="top" data-original-title="删除"><i class="fa fa-times"></i></a>
                            </div>

                            <div class="visible-xs visible-sm hidden-md hidden-lg">
                                <div class="btn-group">
                                    <a class="btn btn-green dropdown-toggle btn-sm" data-toggle="dropdown" href="#">
                                        <i class="fa fa-cog"></i> <span class="caret"></span>
                                    </a>
                                    <ul role="menu" class="dropdown-menu pull-right dropdown-dark">
                                        <li>
                                            <a role="menuitem" tabindex="-1" href="/admin_live/edit?id=<?=$tRow['id']?>">
                                                <i class="fa fa-edit"></i>编辑
                                            </a>
                                        </li>
                                        <li>
                                            <a role="menuitem" tabindex="-1" href="/admin_comment/index?live_id=<?=$tRow['id']?>">
                                                <i class="fa fa-share"></i>查看评论
                                            </a>
                                        </li>
                                        <li>
                                            <a role="menuitem" tabindex="-1" href="#"  onclick="cg_confirm_del('/admin_live/del?id=<?=$tRow['id']?>','/admin_live')">
                                                <i class="fa fa-times"></i>删除
                                            </a>
                                        </li>
                                    </ul>
                                </div>
                            </div>
                        </td>
                    </tr>
<?}?>
                </table>
                <?=$tShow?>
            </div>
        </div>
        <div class="subviews">
            <div class="subviews-container"></div>
        </div>
    </div>
    <!-- end: PAGE -->
</div>
<!-- end: MAIN CONTAINER -->

<script type="text/javascript" src="/plugins/datetimepicker/js/bootstrap-datetimepicker.js"></script>
<script type="text/javascript" src="/plugins/datetimepicker/js/locales/bootstrap-datetimepicker.zh-CN.js" charset="UTF-8"></script>
<script type="text/javascript">
$('.form_date').datetimepicker({
    language:  'zh-CN',
    weekStart: 1,
    todayBtn:  1,
    autoclose: 1,
    todayHighlight: 1,
    startView: 2,
    minView: 2,
    startDate:'2016-01-01',
    endDate:'2030-12-30',
    pickerPosition: "bottom-left",
    forceParse: 1
});
</script>

<script>
$('#search').click(function(){
    $('form').submit();
});
$('input[type="radio"]').each(function(){
	$(this).on('click',function(){
		var tid = $(this).attr('s');
		var val = $(this).val();
		var p = GetQuery('p');
		$.post('/admin_live/index?p='+p,{"tid":tid,"val":val},function(obj){alert(obj.msg);location.href='/admin_live/index?p='+p;});
	});		
});
/*获取地址栏参数*/
function GetQuery(key){
	var search = location.search.slice(1);//得到get方式提交的查询字符串
	var arr = search.split("&");
	for(var i = 0; i < arr.length; i++){
		var ar = arr[i].split("=");
		if(ar[0] == key){
			return ar[1];
		}
	}
}
</script>
<?php include PATH_TPL."/admin/tpl.footer.phtml"?>
